﻿@{
    ViewBag.Title = "IframeAction";
}
@section HeaderContent{
    <script type="text/javascript">
        function upload() {
            document.getElementById("form").submit();
        }
    </script>
}
<h2>
    使用Iframe上传文件，ie下会新添加一个网页</h2>
<form id="form" name="form" action="@Url.Action("SaveFile", "Home")" method="post" enctype="multipart/form-data" target="iframeBlock">
<input type="file" id="file" name="file" />
<input type="button" value="上传" onclick="upload()" />
<input type="hidden" name="author" value="kid" />
</form>
<iframe id="iframeBlock" class="hide"></iframe>